lobsterlayui.main(['index', 'layer', 'form', 'element'], {
    data: {
        $layui: null,
        info: null,
        list: []
    },
    pageload: function (right) {
        console.log(right);

        this.initevent();

        var item = parent.currData;
        if (item.IsNeedPay == 0) {
            item.OrderStateTxt = "无需支付";
        } else {
            if (item.OrderState == 1 || item.OrderState == 0) {
                item.OrderStateTxt = "待支付";
            } else if (item.OrderState == 2) {
                item.OrderStateTxt = "已支付";
            } else if (item.OrderState == 5) {
                item.OrderStateTxt = "已取消";
            } else if (item.OrderState == 6) {
                item.OrderStateTxt = "退款中";
            } else {
                item.OrderStateTxt = "已退款";
            }
        }
        if (item.RegState == 1) {
            item.RegStateTxt = "待预约";
        } else if (item.RegState == 2) {
            item.RegStateTxt = "预约成功";
        } else if (item.RegState == 3) {
            item.RegStateTxt = "预约失败";
        } else if (item.RegState == 4) {
            item.RegStateTxt = "预约取消";
        }

        if (item.PayMode == 1) {
            item.PayModeTxt = '微信';
        }
        else if (item.PayMode == 2) {
            item.PayModeTxt = '医保';
        } else {
            item.PayModeTxt = '其他';
        }

        this.data.info = item;
        this.viewTemp();
    },
    viewTemp: function () {
        console.log(this.data.info);
        var getTpl = datatemp.innerHTML, view = document.getElementById('dataview');
        layui.laytpl(getTpl).render(this.data.info, function (html) {
            view.innerHTML = html;
            layui.form.render();
        });
    },
    initevent() {
        var self = this;
    }
})